import * as actionTypes from './constant';
import { getStudentInfo, uploadStudentInfo } from '../../services';

const changeStudentInfo = (res) => ({
    type:actionTypes.CHANGE_STUDENT_INFO,
    studentInfo: res.data
})

export const getStudentInfoAction = () => {
    return dispatch => {
        getStudentInfo().then(res => {
            // console.log(res);
            dispatch(changeStudentInfo(res));
        })
    }
} 

export const postStudentInfoAction = (studentInfo) => {
    return dispatch => {
        uploadStudentInfo(studentInfo).then(res => {

            console.log(res);
        })
    }
}